package com.TestDemo.Test202203To04;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: zjz
 * @Date: 2022/05/25/9:11
 * @Description:
 * @Target:
 */
public class javaObject {
    public static void main(String[] args) {
        int N = 5;
        Letters[] letters = new Letters[N];
        for (int i = 0; i < N; i++) {
            letters[i] = new Letters((char) ('A'+i),i,i);
        }

        for (Letters letter : letters) {
            System.out.println(letter.toString());
        }


    }



    static class Letters{
        private char c1;
        private int value1;
        private int value2;

        public Letters() {
        }

        public Letters(char c1, int value1, int value2) {
            this.c1 = c1;
            this.value1 = value1;
            this.value2 = value2;
        }


        public char getC1() {
            return c1;
        }

        public void setC1(char c1) {
            this.c1 = c1;
        }

        public int getValue1() {
            return value1;
        }

        public void setValue1(int value1) {
            this.value1 = value1;
        }

        public int getValue2() {
            return value2;
        }

        public void setValue2(int value2) {
            this.value2 = value2;
        }


        @Override
        public String toString() {
            return "Letters{" +
                    "c1=" + c1 +
                    ", value1=" + value1 +
                    ", value2=" + value2 +
                    '}';
        }
    }
}
